﻿@model Gfw.Web.Models.Stock.BuyModel
@{
    ViewBag.Title = "买入";
    Layout = "~/Views/Shared/_LayoutContent.cshtml";
}
@if (Model.CanBuy)
{
    using (Html.BeginForm())
    {
    <ul>
        <li>
            @Html.LabelFor(model => model.CurrentPrice)
        </li>
        <li>
            @Html.DisplayFor(model => model.CurrentPrice)
        </li>
        <li>
            @Html.LabelFor(model => model.Balance)
        </li>
        <li>
            @Html.DisplayFor(model => model.Balance)
        </li>
        <li>
            @Html.LabelFor(model => model.MaxCount)
        </li>
        <li>
            @Html.DisplayFor(model => model.MaxCount)
        </li>
        <li>
            @Html.LabelFor(model => model.BuyCount)
        </li>
        <li>
            @Html.EditorFor(model => model.BuyCount)
            @Html.HiddenFor(model => model.CurrentPrice)
            @Html.HiddenFor(model => model.Balance)
            @Html.HiddenFor(model => model.MaxCount)
            @Html.ValidationMessageFor(model => model.BuyCount)
        </li>
    </ul>
    @Html.ValidationSummary(true)
    <div class="button">
        @Html.ActionLink("返回", "Index")
        <input type="submit" value="提交" onclick="this.disabled = true; this.form.submit();"/>
    </div>

    }
}
else
{
    <h5>
        当前时间不能进行买入操作。</h5>
    <div class="button">
        @Html.ActionLink("返回", "Index")
    </div>
}
